/*
 * Copyright 2022 The Open Islands Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.openislands.oi.pojo.dto;

import org.openislands.oi.constant.*;
import org.openislands.oi.pojo.base.OfNodeTaskCommonPOJO;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;

public class OfNodeTaskDTO extends OfNodeTaskCommonPOJO implements Serializable {
    //from task
    private ExecutionEnvironment executionEnvironment;
    private OperatorType operatorType;
    private AlgorithmType operatorAlgorithm;
    private String leaderNode;
    private Map<RoleType, List<String>> nodes;
    private OperatorDTO operator;
    //from create
    private OperatorContainerType containerType;
    private Integer cores;
    private String memory;
    private String taskConfig;
    private DataFormat outputDataFormat;
    private ModelFormat outputModelFormat;
    //docker://xxxx or pod://xx or subprocess://
    private String containerInstance;
    private TaskState state;
    private Integer progress;
    private Date submittedTime;
    private Date pendingTime;
    private Date activatingTime;
    private Date latestHeartbeat;
    private Date endTime;
    private Integer elapsed;

    public OperatorType getOperatorType() {
        return operatorType;
    }

    public void setOperatorType(OperatorType operatorType) {
        this.operatorType = operatorType;
    }

    public AlgorithmType getOperatorAlgorithm() {
        return operatorAlgorithm;
    }

    public void setOperatorAlgorithm(AlgorithmType operatorAlgorithm) {
        this.operatorAlgorithm = operatorAlgorithm;
    }

    public OperatorContainerType getContainerType() {
        return containerType;
    }

    public void setContainerType(OperatorContainerType containerType) {
        this.containerType = containerType;
    }

    public String getTaskConfig() {
        return taskConfig;
    }

    public void setTaskConfig(String taskConfig) {
        this.taskConfig = taskConfig;
    }

    public Integer getCores() {
        return cores;
    }

    public void setCores(Integer cores) {
        this.cores = cores;
    }

    public String getMemory() {
        return memory;
    }

    public void setMemory(String memory) {
        this.memory = memory;
    }

    public String getContainerInstance() {
        return containerInstance;
    }

    public void setContainerInstance(String containerInstance) {
        this.containerInstance = containerInstance;
    }

    public TaskState getState() {
        return state;
    }

    public void setState(TaskState state) {
        this.state = state;
    }

    public Integer getProgress() {
        return progress;
    }

    public void setProgress(Integer progress) {
        this.progress = progress;
    }

    public Date getSubmittedTime() {
        return submittedTime;
    }

    public void setSubmittedTime(Date submittedTime) {
        this.submittedTime = submittedTime;
    }

    public Date getPendingTime() {
        return pendingTime;
    }

    public void setPendingTime(Date pendingTime) {
        this.pendingTime = pendingTime;
    }

    public Date getActivatingTime() {
        return activatingTime;
    }

    public void setActivatingTime(Date activatingTime) {
        this.activatingTime = activatingTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Integer getElapsed() {
        return elapsed;
    }

    public void setElapsed(Integer elapsed) {
        this.elapsed = elapsed;
    }

    public String getLeaderNode() {
        return leaderNode;
    }

    public void setLeaderNode(String leaderNode) {
        this.leaderNode = leaderNode;
    }

    public Date getLatestHeartbeat() {
        return latestHeartbeat;
    }

    public void setLatestHeartbeat(Date latestHeartbeat) {
        this.latestHeartbeat = latestHeartbeat;
    }

    public Map<RoleType, List<String>> getNodes() {
        return nodes;
    }

    public void setNodes(Map<RoleType, List<String>> nodes) {
        this.nodes = nodes;
    }

    public OperatorDTO getOperator() {
        return operator;
    }

    public void setOperator(OperatorDTO operator) {
        this.operator = operator;
    }

    public DataFormat getOutputDataFormat() {
        return outputDataFormat;
    }

    public void setOutputDataFormat(DataFormat outputDataFormat) {
        this.outputDataFormat = outputDataFormat;
    }

    public ModelFormat getOutputModelFormat() {
        return outputModelFormat;
    }

    public void setOutputModelFormat(ModelFormat outputModelFormat) {
        this.outputModelFormat = outputModelFormat;
    }

    public ExecutionEnvironment getExecutionEnvironment() {
        return executionEnvironment;
    }

    public void setExecutionEnvironment(ExecutionEnvironment executionEnvironment) {
        this.executionEnvironment = executionEnvironment;
    }
}
